package com.ruoyi.common.core.domain.entity;

import com.ruoyi.common.core.domain.BaseEntity;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import java.util.ArrayList;
import java.util.List;

/**
 * 科目表 sys_dept
 * 
 * @author yjf
 */
public class SysSubject extends BaseEntity
{

    /** 类别ID */
    private Long deptId;

    /** 类别名称 */
    private String deptName;

    /** 键值 */
    private String figure;

    /** 父类别名称 */
    private String parentName;

    /** 父类别ID */
    private Long parentId;

    /** 类型 */
    private String type;

    /** 显示顺序 */
    private Integer orderNum;

    /** 类别状态（0显示 1隐藏） */
    private String status;

    /** 删除标志（0代表存在 2代表删除） */
    private String delFlag;

    /** 子类别 */
    private List<SysDept> children = new ArrayList<SysDept>();

    public Long getSubjectId()
    {
        return deptId;
    }

    public void setSubjectId(Long deptId)
    {
        this.deptId = deptId;
    }

    public String getDelFlag() {
        return delFlag;
    }

    public void setDelFlag(String delFlag) {
        this.delFlag = delFlag;
    }

    @NotBlank(message = "类别名称不能为空")
    @Size(min = 0, max = 50, message = "类别名称长度不能超过50个字符")
    public String getSubjectName()
    {
        return deptName;
    }

    public void setSubjectName(String deptName)
    {
        this.deptName = deptName;
    }

    public String getParentName()
    {
        return parentName;
    }

    public void setParentName(String parentName)
    {
        this.parentName = parentName;
    }

    public Long getParentId()
    {
        return parentId;
    }

    public void setParentId(Long parentId)
    {
        this.parentId = parentId;
    }

    public String getSubjectType() {
        return type;
    }

    public void setSubjectType(String type) {
        this.type = type;
    }

    @NotNull(message = "显示顺序不能为空")
    public Integer getOrderNum()
    {
        return orderNum;
    }

    public void setOrderNum(Integer orderNum)
    {
        this.orderNum = orderNum;
    }

    public String getStatus()
    {
        return status;
    }

    public void setStatus(String status)
    {
        this.status = status;
    }

    public List<SysDept> getChildren()
    {
        return children;
    }

    public void setChildren(List<SysDept> children)
    {
        this.children = children;
    }

    public String getSubjectValue() {
        return figure;
    }

    public void setSubjectValue(String figure) {
        this.figure = figure;
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
            .append("deptId", getSubjectId())
            .append("deptName", getSubjectName())
            .append("parentId", getParentId())
            .append("orderNum", getOrderNum())
            .append("status ", getStatus())
            .append("createTime", getCreateTime())
            .append("updateTime", getUpdateTime())
            .toString();
    }
}
